﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Word文档保存后获取返回值</title>
    <script type="text/javascript">
        function Save() {
            var saveUrl = "/SaveReturnValue/SaveDoc";
            pageofficectrl.SaveFilePage = saveUrl;

            pageofficectrl.WebSave();
            //pageofficectrl.CustomSaveResult获取的是保存页面后台代码 fs.CustomSaveResult = "OK"; 定义的返回值
            alert("保存成功，返回值为：" + pageofficectrl.CustomSaveResult);
        }


        function OnPageOfficeCtrlInit() {
            pageofficectrl.Caption = "演示：保存返回值";
            pageofficectrl.AddCustomToolButton("保存", "Save", 1);
        }

    </script>
</head>
<body >
    <form id="form1">
        <div style=" font-size:small; color:Red;">
            <label>关键代码：点右键，选择“查看网页源代码”，看js函数“Save()”</label>
            <br />pageofficectrl.WebSave() //执行保存操作
            <br />pageofficectrl.CustomSaveResult //获取返回值保存页面SaveFile代码fs.setCustomSaveResult("ok");定义的返回值
            <br />
        </div>
        <div style=" width:auto; height:900px;">
            @Html.Raw(ViewBag.poCtrl)
        </div>
    </form>
</body>
</html>
